import java.util.*;

public class Solution2 {
    /**
     * 找到数组中只出现一次的数字
     * @param Numbers
     * @return
     */
    public int singleNumbers(int [] Numbers){
        HashSet<Integer> set=new HashSet<>();
        for (int i = 0; i <Numbers.length; i++) {
              if (!set.contains(Numbers[i])){
                  set.add(Numbers[i]);
              }else {
                  set.remove(Numbers[i]);
              }
        }
        for (int i = 0; i < Numbers.length; i++) {
            if (set.contains(Numbers[i])){
                return Numbers[i];
            }
        }
        return -1;
    }
    /**
     * 用HashMap去统计key出现的次数
     */
    public static void main1(String[] args) {
        int [] array={1,2,3,4,5,3,2,4,1};
        HashMap<Integer,Integer> map=new HashMap<>();
        for (int i = 0; i < array.length; i++) {
            if (map.get(array[i])==null){
                //说明当前array[i]在map中一次都没有出现过
                map.put(array[i],1 );
            }else {
                Integer val=map.get(array[i]);
                map.put(array[i],val+1 );
            }
        }
        Set<Map.Entry<Integer, Integer>> entries = map.entrySet();
        for (Map.Entry<Integer, Integer> entry:entries) {
            System.out.println("val:"+entry.getKey()+" "+"->"+"value:"+""+entry.getValue());
        }
    }
    /**
     * 宝石与石头
     */
    public int numJewelsInStones(String jewels, String stones){
        HashSet<Character> set=new HashSet<>();
        int count=0;
        for (int i = 0; i < jewels.length(); i++) {
            char ch=jewels.charAt(i);
            set.add(ch);
        }
        for (int i = 0; i < stones.length(); i++) {
            char ch=stones.charAt(i);
            if (set.contains(ch)){
                count++;
            }
        }
        return count;
    }
    /**
     * 复制带随机值真的链表
     */
    class Node{
        public int val;
        public Node next;
        public Node random;
        public Node(int val){
            this.val=val;
        }
    }
    public Node copyRandomList(Node head){
        //首先对参数进行判断
        if (head==null){
            return null;
        }
        Map<Node,Node> map=new HashMap<>();
        Node cur=head;
        //构建出新节点
        while (cur!=null){
            Node newNode=new Node(cur.val);
            map.put(cur,newNode);
            cur=cur.next;
        }
        cur=head;
        while (cur!=null){
            map.get(cur).next=map.get(cur.next);
            map.get(cur).random=map.get(cur.random);
            cur=cur.next;
        }
        return map.get(head);
    }

    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        while (in.hasNextLine()){
            String str1=in.nextLine();
            String str2=in.nextLine();
            func(str1,str2);
        }
    }

    private static void func(String str1, String str2) {
        HashSet<Character> set=new HashSet<>();
        for (char ch:str2.toUpperCase().toCharArray()){
            set.add(ch);
        }
        HashSet<Character> setBroken=new HashSet<>();
        for (char ch:str1.toUpperCase().toCharArray()){
            if (!set.contains(ch)&&!setBroken.contains(ch)){
                setBroken.add(ch);
                System.out.println(ch);
            }
        }
    }
}
